import request from '@/utils/request'
import { HTTP_METHOD } from '@/utils/const/http/method'

const baseUrl = '/auth/cms/column/user/'

/**
 * 查询有某栏目权限的用户
 *
 * @param columnId     栏目
 * @return List<CmsColumnUser>
 */
export function selectUsersByColumnId (columnId) {
  return request({
    url: `${baseUrl}users/by/column/id/${columnId}`,
    method: HTTP_METHOD.GET
  })
}

/**
 * 查询某用户拥有的栏目权限
 *
 * @param userId       用户id
 * @return List<CmsColumnUser>
 */
export function selectColumnsByUserId (userId) {
  return request({
    url: `${baseUrl}columns/by/user/id`,
    method: HTTP_METHOD.GET,
    params: {
      userId
    }
  })
}
